package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.CustomerOrdersProjectMapper;
import com.zzyl.service.CustomerOrdersProjectService;
import com.zzyl.vo.NursingProjectVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @Description CustomerOrdersProjectServiceImpl
 * @Author Lwj
 * @Date 2024-08-31-11:20
 */
@Service
public class CustomerOrdersProjectServiceImpl implements CustomerOrdersProjectService {
    @Autowired
    private CustomerOrdersProjectMapper customerOrdersProjectMapper;

    /**
     * 分页查询
     *
     * @param name
     * @param pageNumb
     * @param pageSize
     * @param status
     * @return
     */
    @Override
    public PageResponse<NursingProjectVo> getPage(String name, Integer pageNumb, Integer pageSize, Integer status) {
        PageHelper.startPage(pageNumb, pageSize);
        Page<NursingProjectVo> page = customerOrdersProjectMapper.selectgetPage(name, status);
        PageResponse<NursingProjectVo> pageResponse = new PageResponse<>(page);
        pageResponse.setRecords(page.getResult());
        return pageResponse;
    }

    /**
     * 查询护理项目信息
     *
     * @param id
     * @return
     */
    @Override
    public NursingProjectVo getCustomerNursingProject(Long id) {
        NursingProjectVo nursingProjectVo = customerOrdersProjectMapper.selectByid(id);
        return nursingProjectVo;
    }
}
